package com.wedo.mall.activity.user;

import android.os.Bundle;
import android.widget.TextView;

import com.e.library.activity.EActivity;
import com.e.library.http.EApi;
import com.e.library.utils.EViewUtils;
import com.e.library.widget.ETitleBar;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.wedo.mall.R;
import com.wedo.mall.adapter.WalletDetailAdapter;
import com.wedo.mall.entity.MoneyLog;
import com.wedo.mall.ptr.Pull2Refresh;

import butterknife.BindView;

public class WalletDetailActivity extends EActivity {

    @BindView(R.id.title_bar) ETitleBar title_bar;
    @BindView(R.id.tv_empty) TextView tv_empty;
    @BindView(R.id.rv_list) XRecyclerView rv_list;

    private WalletDetailAdapter walletDetailAdapter;

    private Pull2Refresh<MoneyLog> ptr;

    @Override
    protected int layout() {
        return R.layout.activity_wallet_detail;
    }

    @Override
    protected void onActivityCreated(Bundle state) {

        title_bar.showForwordTv();
        title_bar.setForwardTextColor(getResources().getColor(R.color.user_addresslist_font));

        rv_list.setHasFixedSize(true);
        EViewUtils.vertical(rv_list);

        ptr = new Pull2Refresh<>();

        walletDetailAdapter = new WalletDetailAdapter(this,null);

        ptr.widget(rv_list).adapter(walletDetailAdapter).url(EApi.USER_MONEYLOG).clazz(MoneyLog.class).emptyWidget(tv_empty).done();
    }

}
